﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Data;

namespace produccion
{
    public  class VMreutil
    {

        public class tallaje : ObservableObject
        {
            public void consTallaje()
            {
                try
                {
                    DataTable val = new clases.CLSMAEPRO { CODREF_PRO = codref }.ConsTallaje();
                    foreach (DataRow r in val.Rows)
                    {
                        switch (Convert.ToUInt32(r["POSTAL_TAL"]))
                        {
                            case 1:
                                tal1 = r["CODTAL_TAL"].ToString();
                                break;
                            case 2:
                                tal2 = r["CODTAL_TAL"].ToString();
                                break;
                            case 3:
                                tal3 = r["CODTAL_TAL"].ToString();
                                break;
                            case 4:
                                tal4 = r["CODTAL_TAL"].ToString();
                                break;
                            case 5:
                                tal5 = r["CODTAL_TAL"].ToString();
                                break;
                            case 6:
                                tal6 = r["CODTAL_TAL"].ToString();
                                break;
                            case 7:
                                tal7 = r["CODTAL_TAL"].ToString();
                                break;
                            case 8:
                                tal8 = r["CODTAL_TAL"].ToString();
                                break;
                            case 9:
                                tal9 = r["CODTAL_TAL"].ToString();
                                break;
                            case 10:
                                tal10 = r["CODTAL_TAL"].ToString();
                                break;
                            case 11:
                                tal11 = r["CODTAL_TAL"].ToString();
                                break;
                            case 12:
                                tal12 = r["CODTAL_TAL"].ToString();
                                break;
                            case 13:
                                tal13 = r["CODTAL_TAL"].ToString();
                                break;
                            case 14:
                                tal14 = r["CODTAL_TAL"].ToString();
                                break;
                            case 15:
                                tal15 = r["CODTAL_TAL"].ToString();
                                break;
                            case 16:
                                tal16 = r["CODTAL_TAL"].ToString();
                                break;
                            case 17:
                                tal17 = r["CODTAL_TAL"].ToString();
                                break;
                            case 18:
                                tal18 = r["CODTAL_TAL"].ToString();
                                break;
                            case 19:
                                tal19 = r["CODTAL_TAL"].ToString();
                                break;
                            case 20:
                                tal20 = r["CODTAL_TAL"].ToString();
                                break;
                        }
                    }
                }
                catch (Exception ex) { MessageBox.Show(ex.Message); }
            }

            private string _codref;
            public string codref
            {
                get { return _codref; }
                set
                {
                    _codref = value;
                    consTallaje();
                    RaisePropertyChangedEvent("codref");
                }
            }

            private string _tal1;
            public string tal1
            {
                get { return _tal1; }
                set { _tal1 = value; RaisePropertyChangedEvent("tal1"); }
            }

            private string _tal2;
            public string tal2
            {
                get { return _tal2; }
                set { _tal2 = value; RaisePropertyChangedEvent("tal2"); }
            }

            private string _tal3;
            public string tal3
            {
                get { return _tal3; }
                set { _tal3 = value; RaisePropertyChangedEvent("tal3"); }
            }

            private string _tal4;
            public string tal4
            {
                get { return _tal4; }
                set { _tal4 = value; RaisePropertyChangedEvent("tal4"); }
            }

            private string _tal5;
            public string tal5
            {
                get { return _tal5; }
                set { _tal5 = value; RaisePropertyChangedEvent("tal5"); }
            }

            private string _tal6;
            public string tal6
            {
                get { return _tal6; }
                set { _tal6 = value; RaisePropertyChangedEvent("tal6"); }
            }

            private string _tal7;
            public string tal7
            {
                get { return _tal7; }
                set { _tal7 = value; RaisePropertyChangedEvent("tal7"); }
            }

            private string _tal8;
            public string tal8
            {
                get { return _tal8; }
                set { _tal8 = value; RaisePropertyChangedEvent("tal8"); }
            }

            private string _tal9;
            public string tal9
            {
                get { return _tal9; }
                set { _tal9 = value; RaisePropertyChangedEvent("tal9"); }
            }

            private string _tal10;
            public string tal10
            {
                get { return _tal10; }
                set { _tal10 = value; RaisePropertyChangedEvent("tal10"); }
            }

            private string _tal11;
            public string tal11
            {
                get { return _tal11; }
                set { _tal11 = value; RaisePropertyChangedEvent("tal11"); }
            }

            private string _tal12;
            public string tal12
            {
                get { return _tal12; }
                set { _tal12 = value; RaisePropertyChangedEvent("tal12"); }
            }

            private string _tal13;
            public string tal13
            {
                get { return _tal13; }
                set { _tal13 = value; RaisePropertyChangedEvent("tal13"); }
            }

            private string _tal14;
            public string tal14
            {
                get { return _tal14; }
                set { _tal14 = value; RaisePropertyChangedEvent("tal14"); }
            }

            private string _tal15;
            public string tal15
            {
                get { return _tal15; }
                set { _tal15 = value; RaisePropertyChangedEvent("tal15"); }
            }

            private string _tal16;
            public string tal16
            {
                get { return _tal16; }
                set { _tal16 = value; RaisePropertyChangedEvent("tal16"); }
            }

            private string _tal17;
            public string tal17
            {
                get { return _tal17; }
                set { _tal17 = value; RaisePropertyChangedEvent("tal17"); }
            }

            private string _tal18;
            public string tal18
            {
                get { return _tal18; }
                set { _tal18 = value; RaisePropertyChangedEvent("tal18"); }
            }

            private string _tal19;
            public string tal19
            {
                get { return _tal19; }
                set { _tal19 = value; RaisePropertyChangedEvent("tal19"); }
            }

            private string _tal20;
            public string tal20
            {
                get { return _tal20; }
                set { _tal20 = value; RaisePropertyChangedEvent("tal20"); }
            }
        }

    }
}
